package com.card.game.ddz;

import java.util.Comparator;

import com.card.game.Card;

public class DdzComp implements Comparator<Card>{

	@Override
	public int compare(Card o1, Card o2) {
		if(o1.getType() == 4 && o2.getType() != 4) {
			return -1;
		}
		if(o2.getType() == 4 && o1.getType() != 4) {
			return 1;
		}
		if(o1.getIndex() == o2.getIndex()) {
			return o1.getType() - o2.getType();
		}
		return o2.getIndex()-o1.getIndex();
	}
	
}
